import 'package:json_annotation/json_annotation.dart';

part 'checkout_model.g.dart';


@JsonSerializable()
class CheckoutModel extends Object {

  List<Address_list>? address_list;

  List<Available_payment_type>? available_payment_type;

  List<List<dynamic>>? store_shipping_type;

  int? only_pick_up;

  List<Cart_list> cart_list;

  Total total;

  int? balance;

  int? points;

  int? available_points;

  Coupon_list coupon_list;

  Item? item;

  List<dynamic>? use_coupon_ids;

  List<dynamic>? select_user_coupon_ids;

  List<String>? tmpl_ids;

  int? flow_type;

  int errcode;

  String message;

  CheckoutModel(this.address_list,this.available_payment_type,this.store_shipping_type,this.only_pick_up,this.cart_list,this.total,this.balance,this.points,this.available_points,this.coupon_list,this.item,this.use_coupon_ids,this.select_user_coupon_ids,this.tmpl_ids,this.flow_type,this.errcode,this.message,);

  factory CheckoutModel.fromJson(Map<String, dynamic> srcJson) => _$CheckoutModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CheckoutModelToJson(this);

}


@JsonSerializable()
class Address_list extends Object {

  String region_name;

  int address_id;

  String address_tag;

  int user_id;

  String consignee;

  String email;

  List<int> region_ids;

  List<String> region_names;

  String address;

  String postcode;

  String telephone;

  String mobile;

  int is_default;

  int is_selected;

  Address_list(this.region_name,this.address_id,this.address_tag,this.user_id,this.consignee,this.email,this.region_ids,this.region_names,this.address,this.postcode,this.telephone,this.mobile,this.is_default,this.is_selected,);

  factory Address_list.fromJson(Map<String, dynamic> srcJson) => _$Address_listFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Address_listToJson(this);

}


@JsonSerializable()
class Available_payment_type extends Object {

  int type_id;

  String type_name;

  bool disabled;

  String disabled_desc;

  bool is_show;

  Available_payment_type(this.type_id,this.type_name,this.disabled,this.disabled_desc,this.is_show,);

  factory Available_payment_type.fromJson(Map<String, dynamic> srcJson) => _$Available_payment_typeFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Available_payment_typeToJson(this);

}


@JsonSerializable()
class Cart_list extends Object {

  int shop_id;

  String shop_title;

  List<Carts> carts;

  dynamic used_promotions;

  dynamic enableUsePromotion;

  dynamic gift;

  CartTotal total;

  Cart_list(this.shop_id,this.shop_title,this.carts,this.used_promotions,this.enableUsePromotion,this.gift,this.total,);

  factory Cart_list.fromJson(Map<String, dynamic> srcJson) => _$Cart_listFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Cart_listToJson(this);

}


@JsonSerializable()
class Carts extends Object {

  int cart_id;

  int user_id;

  int product_id;

  String product_sn;

  String pic_thumb;

  String market_price;

  String original_price;

  int quantity;

  int sku_id;

  List<dynamic> sku_data;

  Sku_list? sku;

  int product_type;

  bool is_checked;

  int shop_id;

  int type;

  int update_time;

  int salesman_id;

  String product_weight;

  int shipping_tpl_id;

  int free_shipping;

  int product_status;

  String product_name;

  String product_price;

  int category_id;

  int brand_id;

  int product_stock;

  int card_group_id;

  String virtual_sample;

  Shop? shop;

  int price;

  int member_discount;

  int stock;

  bool has_sku;

  String subtotal;

  int origin_price;

  bool is_disabled;

  Carts(this.cart_id,this.user_id,this.product_id,this.product_sn,this.pic_thumb,this.market_price,this.original_price,this.quantity,this.sku_id,this.sku_data,this.product_type,this.is_checked,this.shop_id,this.type,this.update_time,this.salesman_id,this.product_weight,this.sku,this.shipping_tpl_id,this.free_shipping,this.product_status,this.product_name,this.product_price,this.category_id,this.brand_id,this.product_stock,this.card_group_id,this.virtual_sample,this.price,this.member_discount,this.stock,this.has_sku,this.subtotal,this.origin_price,this.is_disabled,{this.shop});

  factory Carts.fromJson(Map<String, dynamic> srcJson) => _$CartsFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CartsToJson(this);

}



@JsonSerializable()
class Shop extends Object {

  String status_text;

  int shop_id;

  String shop_title;

  String shop_logo;

  Shop(this.status_text,this.shop_id,this.shop_title,this.shop_logo,);

  factory Shop.fromJson(Map<String, dynamic> srcJson) => _$ShopFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ShopToJson(this);

}


@JsonSerializable()
class CartTotal extends Object {

  int discount_coupon_amount;

  int discount_seckill_amount;

  int discount_time_discount_amount;

  int discount_product_promotion_amount;

  int discount_discount_amount;

  int discounts;

  List<dynamic> coupon_ids;

  CartTotal(this.discount_coupon_amount,this.discount_seckill_amount,this.discount_time_discount_amount,this.discount_product_promotion_amount,this.discount_discount_amount,this.discounts,this.coupon_ids,);

  factory CartTotal.fromJson(Map<String, dynamic> srcJson) => _$CartTotalFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CartTotalToJson(this);

}


@JsonSerializable()
class Total extends Object {

  num product_amount;

  num checked_count;

  dynamic discounts;

  num discount_after;

  num total_count;

  num? discount_coupon_amount;

  num discount_discount_amount;

  String member_discount_amount;

  num discount_seckill_amount;

  num discount_product_promotion_amount;

  num discount_time_discount_amount;

  num paid_amount;

  num coupon_amount;

  num service_fee;

  num discount_amount;

  num exchange_points;

  num points_amount;

  num shipping_fee;

  List<dynamic> store_shipping_fee;

  num total_amount;

  num balance;

  String unpaid_amount;

  Total(this.product_amount,this.checked_count,this.discounts,this.discount_after,this.total_count,this.discount_coupon_amount,this.discount_discount_amount,this.member_discount_amount,this.discount_seckill_amount,this.discount_product_promotion_amount,this.discount_time_discount_amount,this.paid_amount,this.coupon_amount,this.service_fee,this.discount_amount,this.exchange_points,this.points_amount,this.shipping_fee,this.store_shipping_fee,this.total_amount,this.balance,this.unpaid_amount,);

  factory Total.fromJson(Map<String, dynamic> srcJson) => _$TotalFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TotalToJson(this);

}


@JsonSerializable()
class Coupon_list extends Object {

  List<CouponCheckModel>? enable_coupons;

  List<dynamic> disable_coupons;

  Coupon_list(this.enable_coupons,this.disable_coupons,);

  factory Coupon_list.fromJson(Map<String, dynamic> srcJson) => _$Coupon_listFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Coupon_listToJson(this);

}


@JsonSerializable()
class CouponCheckModel extends Object {

  int id;

  String coupon_name;

  int coupon_type;

  String min_order_amount;

  String coupon_desc;

  String coupon_money;

  int is_global;

  String coupon_discount;

  int shop_id;

  String end_date;

  int coupon_id;

  int user_coupon_id;

  bool? selected;

  CouponCheckModel(this.id,this.coupon_name,this.coupon_type,this.min_order_amount,this.coupon_desc,this.coupon_money,this.is_global,this.coupon_discount,this.shop_id,this.end_date,this.coupon_id,this.user_coupon_id,this.selected,);

  factory CouponCheckModel.fromJson(Map<String, dynamic> srcJson) => _$CouponCheckModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CouponCheckModelToJson(this);

}




@JsonSerializable()
class Item extends Object {

  int address_id;

  List<ShippingType> shipping_type;

  int pay_type_id;

  int use_point;

  int use_balance;

  List<int> use_coupon_ids;

  List<int> select_user_coupon_ids;

  int flow_type;

  Item(this.address_id,this.shipping_type,this.pay_type_id,this.use_point,this.use_balance,this.use_coupon_ids,this.select_user_coupon_ids,this.flow_type,);

  factory Item.fromJson(Map<String, dynamic> srcJson) => _$ItemFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ItemToJson(this);

}

@JsonSerializable()
class ShippingType extends Object {

  int type_id;

  int shop_id;

  String type_name;

  ShippingType(this.type_id,this.shop_id,this.type_name,);

  factory ShippingType.fromJson(Map<String, dynamic> srcJson) => _$ShippingTypeFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ShippingTypeToJson(this);

}


@JsonSerializable()
class Sku_list extends Object {

  int sku_id;

  int product_id;

  String sku_value;

  List<Sku_data> sku_data;

  String sku_sn;

  int sku_stock;

  String sku_tsn;

  String sku_price;

  Sku_list(this.sku_id,this.product_id,this.sku_value,this.sku_data,this.sku_sn,this.sku_stock,this.sku_tsn,this.sku_price,);

  factory Sku_list.fromJson(Map<String, dynamic> srcJson) => _$Sku_listFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Sku_listToJson(this);

}


@JsonSerializable()
class Sku_data extends Object {

  String name;

  String value;

  Sku_data(this.name,this.value,);

  factory Sku_data.fromJson(Map<String, dynamic> srcJson) => _$Sku_dataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$Sku_dataToJson(this);

}

